<?

require_once ("application.fieldset.inc");

global $_GLOBAL_DBH;
global $_OBJECT_IFACE_PANEL;

$fieldset_workgroups = new Fieldset (array (
	db_conn=>$_GLOBAL_DBH,
	relation=>"project_milestone_workgroups_view",
	relation_redirect=>"project_milestone_workgroups",
	prefix=>"pmw_",
	fieldset=>array (
		array (name=>"id",label=>"ID",type=>"numeric",
				value=>$_REQUEST["workgroup_id"],
				input=>"hidden",primary_key=>true),
		array (name=>"title",label=>"Title",type=>"alphanumeric",
				input=>"field"),
		array (name=>"code",label=>"Code",type=>"alphanumeric",
				input=>"field"),
		array (name=>"access",label=>"Access Level",type=>"character",
				input=>"select",
				value=>"new",
				options=>array (
					array (id=>"public",name=>"Public"),
					array (id=>"private",name=>"Private"),
					array (id=>"exclusive",name=>"Exclusive"),
				),
				columns=>array(key=>"id",value=>"name"),
		),
		array (name=>"details",label=>"Details",type=>"alphanumeric",
				input=>"textarea",rows=>5),
		array (name=>"cdate",label=>"Create Date",type=>"any",
				input=>"date_time",value=>_app_date_time ("pmw_cdate")),
	)
));

$fieldset_workgroups->parse ();

$return = "/fs_projects.php?fs_tab_milestones=workgroups&project_id={$_REQUEST["project_id"]}&fs_tab=milestones&fs_tab_option=fs_milestones&fs_action=view&milestone_id={$_REQUEST["milestone_id"]}";

$fs_options = array ();

$image_options = array (size=>$_REQUEST["_img_size"]);

list ($fs_input, $fs_action, $store, $valid, $success) =

	_app_process_fieldset (array (
		fieldset=>$fieldset_workgroups,
		fs_options=>$fs_options,
		fs_primary_key=>"workgroup_id",
		fs_action=>($_REQUEST["fs_action_workgroups"] ?
				$_REQUEST["fs_action_workgroups"] :
				"view"),
		fs_action_field=>"fs_action_workgroups",
		fs_prefix=>"pmw_",
));

$_OBJECT_FIELDSET_CONTROL =_app_create_fieldset_object (array (
	fieldset_id=>"fs_project_milestone_workgroups",
	db_conn=>$_GLOBAL_DBH,
	fieldset=>$fieldset_workgroups,
	fs_action=>$fs_action,
	fs_input=>$fs_input,
	fs_link=>"fs_projects.php?fs_tab=milestones&project_id={$_REQUEST["project_id"]}&fs_tab_option=fs_milestones&fs_action=view&fs_tab_milestones=workgroups&fs_tab_option_milestones=fs_workgroups&milestone_id={$_REQUEST["milestone_id"]}",
	fs_options=>$fs_options,
	fs_action_field=>"fs_action_workgroups",
	fs_prefix=>"pmw_",
));

$_OBJECT_IFACE_TABBING_PANEL->insert_container ($_OBJECT_FIELDSET_CONTROL);

?>
